<tagLib name="html" />
<include file="Public:header" />
<style>
.tab_l3{font-size:14px;}
</style>
<div class="column">
<div class="title"><div class="map"></div><p>GP出售</p></div>
<div class="p10 cont" style="padding:20px">
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tab" >

        <tr>
          <td height="28" colspan="8" align="center"><table width="400" border="0" cellpadding="0" cellspacing="0" class="tab3">
            <form action="__URL__/A_sellGP" method="post" name="form1" id="form1" onsubmit="return checkf();">
              <tr>
                <td width="30%" height="40" align="right">出售数量：</td>
                <td align="left" style="padding-left:10px;"><input name="sNun" type="text" id="sNun" value="{$sNun}" maxlength="20" onblur="tot_price();" readonly="readonly" />
                  个</td>
              </tr>
              <tr>
                <td height="40" align="right">当前价格：</td>
                <td align="left" style="padding-left:10px;"><input name="ttone_price" type="text" id="ttone_price"  maxlength="20" value="{$one_price}" readonly="readonly" />
                  /个</td>
              </tr>
              <tr>
                <td height="40" align="right">出售价格：</td>
                <td align="left" style="padding-left:10px;"><input name="one_price" type="text" id="one_price"  maxlength="20" value="{$one_price}" onblur="value=value.replace(/[^0-9.]/g,'');tot_price();" onpropertychange="tot_price();"/>
                  /个</td>
              </tr>
              <tr>
                <td height="40" align="right">总售价：</td>
                <td align="left" style="padding-left:10px;"><span style="color:#960" id="tot_price">0</span></td>
              </tr>
              <tr>
                <td height="40" align="right">三级密码：</td>
                <td align="left" style="padding-left:10px;"><input name="gp_pwd" type="password" id="gp_pwd" value="" /></td>
              </tr>
              <tr>
                <td height="40" align="right">&nbsp;</td>
                <td align="left" style="padding-left:10px;">
                <eq name="close_gp" value="0">
                  <input type="submit" name="button2" id="button2" value="确认出售" class="btn1" />
                <else />
                  <span style="color:#F00">股市交易已关闭</span>
                </eq>
                  <input name="tid" type="hidden" id="tid" value="{$tid}" />
                  <input name="PID" type="hidden" id="PID" /></td>
              </tr>
            </form>
          </table></td>
        </tr>
      </table>

</div>
</div>
</body>
</html>
<script type="text/javascript">
function tot_price(){
	var one_price = document.getElementById('one_price').value;//单价
	var sNun	= document.getElementById('sNun').value;//数量
	var t_price = formatNumberUnitsDivd(parseFloat(sNun * one_price)); 
	document.getElementById('tot_price').innerHTML = t_price+'';
}
function formatNumberUnitsDivd(num) {
	return num.toFixed(4);
}
function checkf(){
	if(document.form1.one_price.value==""){
		alert("请输入价格");
		document.form1.one_price.focus();
		return false;
	}
	if(document.form1.sNun.value==""){
		alert("请输入出售股票数量");
		document.form1.sNun.focus();
		return false;
	}
	var one_price = document.getElementById('one_price').value;//单价
	var sNun	= document.getElementById('sNun').value;//数量
	var t_price = formatNumberUnitsDivd(parseFloat(sNun * one_price)); 
	if(confirm("您确定要出售 "+document.form1.sNun.value+" 个 股票吗？\n\n售出单价："+document.form1.one_price.value+"\n\n售出总额："+t_price)){
		return true;
	}else{
		return false;
	}
}

tot_price();
</script>